import 'package:flutter/material.dart';

class BaseButton extends StatefulWidget {
  String title;
  VoidCallback onPressed;
  Color titleColor;
  Color backgroundColor;

  BaseButton(this.title, this.onPressed,
      {this.titleColor = Colors.white,
      this.backgroundColor = Colors.blueAccent});

  @override
  _BaseButtonState createState() => _BaseButtonState();
}

class _BaseButtonState extends State<BaseButton> {
  @override
  Widget build(BuildContext context) {
    return SizedBox(
      width: 330.0,
      height: 44.0,
      child: OutlinedButton(
        style: OutlinedButton.styleFrom(
            shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(20.0),
            ),
            padding: EdgeInsets.fromLTRB(25, 10, 25, 10),
            backgroundColor: widget.backgroundColor),
        onPressed: widget.onPressed,
        child: Text(
          widget.title,
          style: TextStyle(color: widget.titleColor, fontSize: 16),
        ),
      ),
    );
  }
}
